export default {
  state: {
    // 配送方式
    send_type: [
      {
        type: 'express',
        name: '配送上门'
      },
      {
        type: 'self',
        name: '自提'
      }
    ],
    send_type_index: 0,

    // 地址选择
    address_list: [],
    now_address_index: 0,

    // 商品数据
    order_info: {
      goods_info: '',
      buy_num: '',//购买数量
      buy_price: '',//商品价格
      rule: '',//规格名称
      rule_id: '',//规格ID
      user_msg: '',//用户留言
      discount: '',//优惠券
    },
    // 购物车信息
    buy_car: {
      count_num:0,
      count_price:'0.00',
      goods_list:[]
    },





    show_pay_succ_view:false ,//是否显示支付成功
    pay_succ_order_id:'', //支付成功的订单ID

  }
  ,
  mutations: {
    // 保存拼团订单信息
    save_group_order_info(state, order_info) {
      state.order_info.goods_info = order_info.goods_info;
      state.order_info.buy_num = order_info.buy_num;
      state.order_info.buy_price = order_info.buy_price;
      state.order_info.rule = order_info.rule;
      state.order_info.rule_id = order_info.rule_id;
      state.order_info.sid = order_info.sid
      console.log(state.order_info)
    },
    // 保存普通商品订单信息
    save_normal_order_info(state, order_info) {
      state.order_info.goods_info = order_info.goods_info;
      state.order_info.buy_num = order_info.buy_num;
      state.order_info.buy_price = order_info.buy_price;
      state.order_info.rule = order_info.rule;
      state.order_info.rule_id = order_info.rule_id;
      console.log(state.order_info)
    },
    // 保存购物车订单信息
    save_buy_car_info(state,car_info) {
        state.buy_car = car_info;
        console.log(state.buy_car)
    },
    open_pay_succ_view(state,tf){
      state.show_pay_succ_view = tf
    }
  }
}
